home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / ldapjdk.jar / netscape / ldap / LDAPControl.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-13  |  1.2 KB  |  63 lines

  1. package netscape.ldap;
  2.  
  3. import java.io.ByteArrayOutputStream;
  4. import java.io.IOException;
  5. import netscape.ldap.ber.stream.BERConstruct;
  6. import netscape.ldap.ber.stream.BERSequence;
  7.  
  8. public class LDAPControl implements Cloneable {
  9.    public static final String MANAGEDSAIT = "2.16.840.1.113730.3.4.2";
  10.    public static final String PWEXPIRED = "2.16.840.1.113730.3.4.4";
  11.    public static final String PWEXPIRING = "2.16.840.1.113730.3.4.5";
  12.    private String m_oid;
  13.    protected boolean m_critical = false;
  14.    protected byte[] m_value;
  15.  
  16.    public LDAPControl() {
  17.    }
  18.  
  19.    public LDAPControl(String var1, boolean var2, byte[] var3) {
  20.       this.m_oid = var1;
  21.       this.m_critical = var2;
  22.       this.m_value = var3;
  23.    }
  24.  
  25.    public String getID() {
  26.       return this.m_oid;
  27.    }
  28.  
  29.    public boolean isCritical() {
  30.       return this.m_critical;
  31.    }
  32.  
  33.    public byte[] getValue() {
  34.       return this.m_value;
  35.    }
  36.  
  37.    public Object clone() {
  38.       byte[] var1 = null;
  39.       if (this.m_value != null) {
  40.          var1 = new byte[this.m_value.length];
  41.  
  42.          for(int var2 = 0; var2 < this.m_value.length; ++var2) {
  43.             var1[var2] = this.m_value[var2];
  44.          }
  45.       }
  46.  
  47.       LDAPControl var3 = new LDAPControl(this.m_oid, this.m_critical, var1);
  48.       return var3;
  49.    }
  50.  
  51.    protected byte[] flattenBER(BERSequence var1) {
  52.       ByteArrayOutputStream var2 = new ByteArrayOutputStream();
  53.  
  54.       try {
  55.          ((BERConstruct)var1).write(var2);
  56.       } catch (IOException var3) {
  57.          return null;
  58.       }
  59.  
  60.       return var2.toByteArray();
  61.    }
  62. }
  63.